#ifndef _LIGHTCONTAINER_H_
#define _LIGHTCONTAINER_H_

#ifdef _WIN32
#pragma once
#endif

/**
 * A container class to hold and interact with all Lights.  
 *
 * 24/02/2012 - Stephen Gore - Created the class structure, implemented from 
 *                             UML with all the get and set functions for all 
 *                             all the attributes of the D3DLIGHT9 structure.
 *
 * 25/02/2012 - Stephen Gore - Defined all original functions. 
 *                           - Commented all functions.
 *                           - Made all functions and parameters that need to 
 *                             be are constant
 */

#include <d3dx9.h>
#include <string>
#include <map>

#include "light.h"

using std::string;
using std::map;
using std::pair;

class CLightContainer
{
public:
    // Get the instance of the container.
    static CLightContainer* getInstance();

    // Interact with the lights. 
    CLight *addLight(string key);
    bool removeLight(string key);
    CLight *getLight(string key) const;

    // Set the lights on the device.
    void setLight(string key, int index, LPDIRECT3DDEVICE9 pDevice);
    void enableLight(int index, LPDIRECT3DDEVICE9 pDevice);
    void disableLight(int index, LPDIRECT3DDEVICE9 pDevice);
private:
    // Constructors.
    CLightContainer(){}
    CLightContainer(const CLightContainer &rhs) {}

    // Destuctor.
    ~CLightContainer();

    // Assignment operator.
    CLightContainer &operator=(const CLightContainer&) {}

    // Lights.
    map<string, CLight*> m_arrLights;
};

#endif